﻿using System;
using System.Collections.Generic;
using DAL_V1.App_Code.DBBroker;
using EntityObjects;
using System.Linq;
using System.Text;
using System.Web;

namespace BAL.Controller
{
    public class ChangeCollectionPointControl
    {
        CollectionPointDBBroker cpRef;
        DepartmentDBBroker depRef;

        public ChangeCollectionPointControl()
        {
            cpRef = CollectionPointDBBroker.getCollectionPointDBBroker();
            depRef = DepartmentDBBroker.getDepartmentDBBroker();
        }
        public List<CollectionPoint> selectAllCollectionPoint()
        {
            List<CollectionPoint> cp_list = new List<CollectionPoint>();
            cp_list = cpRef.selectAllCollectionPoint();
            return cp_list;
        }

        public CollectionPoint selectCollectionPoint(int Id)
        {
            CollectionPoint cp = new CollectionPoint();
            cp = cpRef.selectCollectionPoint(Id);
            return cp;
        }

        public int updateCollectionPoint(CollectionPoint collectionPoint, int Id)
        {
            int val = 0;
            val = cpRef.updateCollectionPoint(collectionPoint, Id);
            return val;
        }
        
        public int updateDepartment(Department dept, String Id)
        {
            int val = 0;
            val = depRef.updateDepartment(dept, Id);
            return val;
        }
       
        public Department getDepartmentByRepId(String repId)
        {
            Department dep = new Department();
            dep = depRef.getDepartmentByRepId(repId);
            return dep;
        }
    }
}
